package com.wyt.design.designmodel.observer;

/**
 * @author weiyatong
 * @version 1.0
 * @date 2021/6/27 下午7:02
 * @describe 观察者测试
 */
public class main {
    public static void main(String[] args) {
        Home home =  new Home(28);
        HomePriceObserver a =  new HomePriceObserver("a");
        HomePriceObserver b = new HomePriceObserver("b");
        home.addObserver(a); //注册为消费者a
        home.addObserver(b); //注册为消费者b
        home.setPrice(30);
    }
}
